Skip to content

feat(anolisa): add native dsh adapter - #2580

Merged
kongche-jbw merged 1 commit into
alibaba:mainfrom
kongche-jbw:feat/anolisa/dsh-adapter
Aug 17, 2026
Merged

feat(anolisa): add native dsh adapter#2580
kongche-jbw merged 1 commit into
alibaba:mainfrom
kongche-jbw:feat/anolisa/dsh-adapter

Conversation

@kongche-jbw

@kongche-jbw kongche-jbw commented Aug 15, 2026

Copy link
Copy Markdown
Collaborator

Why

ANOLISA components need a framework-native way to register plugin bundles with
DeepSeek Harness without editing $DSH_HOME or maintaining component-specific
install scripts. This adds a reusable DSH driver so Tokenless and future
components can use the same adapter contract and DSH-owned lifecycle.

What changed

  • Add a generic dsh framework driver that validates package.json, the
    nested dsh.bundle.patch declaration, and the Cordis patch package identity.
  • Add repeatable anolisa adapter enable <component> dsh --profile <name>
    selection and reject implicit or non-DSH profile usage.
  • Register and remove packages through dsh plugin --profile ..., persist one
    typed receipt for all selected profiles, verify status using exact package
    matches, and clean stale profiles during re-enable.
  • Persist the validated enable-time DSH home in the receipt so status, disable,
    and re-enable cleanup remain anchored when DSH_HOME or the cwd changes.

Other components can reuse the interface by declaring a normal ANOLISA adapter:

[[adapters]]
framework = "dsh"
adapter_type = "plugin"
plugin_id = "my-plugin-id"
source = "adapters/dsh"
dest = "{datadir}/adapters/{component}/dsh/"

[adapters.bundle]
entry = "package.json"

The source directory must contain an npm-compatible package name and nested DSH
bundle metadata:

{
  "name": "@example/dsh-plugin",
  "dsh": { "bundle": { "patch": "./cordis.patch.yml" } }
}

The patch id must match plugin_id, and the plugin name must match the package
installed by DSH:

- insert:
    - id: my-plugin-id
      name: '@example/dsh-plugin'

ANOLISA then delegates registration to DSH with a link: package reference;
components do not write profile files directly.

Related issue

no-issue: introduce the shared DSH adapter contract needed by native plugins

User / Agent impact

Users can enable a component in one or more explicit DSH profiles:

anolisa adapter enable <component> dsh --profile default
anolisa adapter enable <component> dsh --profile web --profile headless

Disable and status use both the profiles and DSH home recorded by the enable
receipt.

Risk and compatibility

  • Public CLI, API, configuration, or documented behavior changed
  • Cross-component contract changed
  • Migration or rollback guidance is needed

The change adds a profiles field to EnableOptions and a dsh receipt
payload, including the validated enable-time DSH home resource. Before
downgrading to an ANOLISA version without this driver, disable all DSH adapters
so older binaries do not encounter the new receipt variant.

Validation

  • cargo fmt --all -- --check
  • cargo test -p anolisa-core --locked
  • cargo test -p anolisa-cli enable_parses_repeatable_profiles --locked
  • cargo clippy -p anolisa-core --all-targets --locked -- -D warnings
  • cargo clippy -p anolisa-cli --all-targets --locked -- -D warnings
  • cargo doc --workspace --no-deps --locked
  • git diff --check

Documentation and rollback

The public Rust items and CLI help document the new contract; no standalone
guide is added in this change. Roll back by disabling DSH adapters first and
then reverting this PR's feature commit.

@github-actions github-actions Bot added the component:anolisa src/anolisa label Aug 15, 2026
@kongche-jbw
kongche-jbw marked this pull request as ready for review August 15, 2026 02:28

@qoderai qoderai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] reenable 清理时将 dsh bundle 解析失败一律视为包名变更,可能误删仍应保留的 profile 注册。
[P2] dsh status 在 verification=Unknown 且存在潜在失败时仍回退为 Unknown,总体验上不易区分“部分失败”与“全部未知”。
[P2] dsh profile 名称校验缺少长度/前缀边界,与可能的上游约束不完全对齐。


🤖 Generated by QoderView workflow run

Comment thread src/anolisa/crates/anolisa-core/src/adapter/dsh.rs Outdated
Comment thread src/anolisa/crates/anolisa-core/src/adapter/dsh.rs
Comment thread src/anolisa/crates/anolisa-core/src/adapter/dsh.rs

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 895940883b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/anolisa/crates/anolisa-core/src/adapter/dsh.rs Outdated
Comment thread src/anolisa/crates/anolisa-core/src/adapter/dsh.rs Outdated
@kongche-jbw
kongche-jbw force-pushed the feat/anolisa/dsh-adapter branch from 8959408 to 9b96438 Compare August 15, 2026 02:48

@ikunkun-sys ikunkun-sys left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed current head 9b96438 against the official DSH bundle and CLI contracts at deepseek-harness commit 47f9438. Local formatting, clippy, workspace tests, docs, and a synthetic merge with current main pass, but the four inline correctness issues below are blocking.

Comment thread src/anolisa/crates/anolisa-core/src/adapter/dsh.rs Outdated
Comment thread src/anolisa/crates/anolisa-core/src/adapter/dsh.rs Outdated
Comment thread src/anolisa/crates/anolisa-core/src/adapter/dsh.rs Outdated
Comment thread src/anolisa/crates/anolisa-core/src/adapter/dsh.rs Outdated
@kongche-jbw
kongche-jbw force-pushed the feat/anolisa/dsh-adapter branch from 9b96438 to 54a3a9b Compare August 15, 2026 03:33

@ikunkun-sys ikunkun-sys left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The previous four blockers are addressed in this revision, and the current code and CI gates pass. One lifecycle correctness issue remains:

  • P1: persist the enable-time DSH home/profile root and use it for both read-only verification and later DSH CLI cleanup. Re-resolving DSH_HOME during status/disable can inspect and mutate a different profile tree, then discard the only receipt while the original registration remains.
  • P2: update the PR description: it still documents name: ./dist/index.js even though the implementation now correctly rejects path-valued plugin names, and its rollback command references the superseded 9b96438e commit.

Comment thread src/anolisa/crates/anolisa-core/src/adapter/claim.rs
@kongche-jbw
kongche-jbw force-pushed the feat/anolisa/dsh-adapter branch from 54a3a9b to 8a90a28 Compare August 16, 2026 07:31
@kongche-jbw

Copy link
Copy Markdown
Collaborator Author

Review update for 8a90a287:

  • Persisted the validated enable-time DSH home in the receipt and Manager trust anchor.
  • Anchored status, disable, and re-enable cleanup reads and CLI mutations to that home, including relative DSH_HOME resolution.
  • Updated the PR example to use the installed package name and removed the stale rollback hash.

Validated with fmt, 15 DSH lifecycle tests, the Manager drift test, workspace clippy, full workspace tests, and docs.

@ikunkun-sys ikunkun-sys left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed current head 8a90a287. The previous DSH-home persistence blocker and the stale PR description are addressed. Rust 1.88 formatting, workspace clippy/tests/docs, remote CI, and a synthetic merge with current main pass, but the re-enable migration issue in the inline P1 remains blocking.

Comment thread src/anolisa/crates/anolisa-core/src/adapter/dsh.rs Outdated
- add generic DSH bundle validation and profile lifecycle
- expose repeatable --profile selections through adapter enable
- persist multi-profile receipts for status and cleanup

Signed-off-by: kongche-jbw <kongche.jbw@alibaba-inc.com>
@kongche-jbw
kongche-jbw force-pushed the feat/anolisa/dsh-adapter branch from 8a90a28 to f4736bf Compare August 17, 2026 02:03

@ikunkun-sys ikunkun-sys left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-reviewed the current head. The prior DSH home migration issue is resolved: same-home retained profiles stay registered, while a home change cleans retained profiles from the persisted prior DSH_HOME before installing the replacement claim. The current head also passes the synthetic merge against latest main, formatting, workspace Clippy/tests/docs, targeted DSH and CLI tests, and remote CI. No remaining blocking findings.

@kongche-jbw
kongche-jbw merged commit 5bbd109 into alibaba:main Aug 17, 2026
24 checks passed
@kongche-jbw
kongche-jbw deleted the feat/anolisa/dsh-adapter branch August 17, 2026 03:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants